﻿#ifndef SERVER_H
#define SERVER_H

#include <QObject>
#include <WinSock2.h>
class Server : public QObject
{
    Q_OBJECT
public:
    explicit Server(QObject *parent = nullptr);
    ~Server();
    bool start(int port = 7555);
    int writeData(const char *, int);

signals:
    void signalConnect();
    void signalDisconnect();
private:
    bool m_exit;
    void acceptClient();
    bool m_init;
    int m_port;
    SOCKET m_socket;
    SOCKET m_connect;
    SOCKADDR_IN m_seradd;
    SOCKADDR_IN m_cliadd;

};

#endif // SERVER_H
